Joshua Alley and Matthew Fuhrmann

Data and code for "Budget Breaker? The Financial Cost of U.S. Military Alliances."

All file paths are set to work in the context of project with separate folders for data, figures, and the appendix.
Paths are relative to a core directory containing these subfolders.
Therefore, the full replication files work best in the context of a project.

In addition to this README, this dataverse archive contains two files. 
full-project.zip is a zip folder with the necessary file structure to clean the data and run the models. 
We strongly recommend using this for replication purposes. 

If you would rather explore our data, us-data-clean.csv is a cleaned dataset for use in any software program. 
Though most of our analyses start in 1947, the csv file contains all data from 1920 to 2019. 
To replicate results in the manuscript, subset this data to years from 1947 onwards. 
us-data-clean.csv is a csv version of the us.data.pre45 dataframe, which we generate using the data-cleaning.R script. 

You can also download the project and corresponding folders from: https://github.com/joshuaalley/us-alliances-milex 

If you download full-project.zip, do-all.R will execute all files in the correct order.
The full analysis should take around an hour to execute.
It will take less time if you exclude the extreme bounds analysis in robustness-checks.R

To run the scripts piecemeal in the project, use the following order:
1. setup-script.R
2. us-commitments.R
3. data-cleaning.R (This calls milex-data.R)
4. analysis-ts-lrm.
5. counterfactual-analysis.R
6. robustness-checks.R
7. analysis-ecm.R
8. analysis-pre45.R
9. analysis-changes.R

All analyses done in R 4.0.2. 